package com.healthshare.busi.share;

import java.util.HashMap;
import java.util.Map;

import com.healthshare.parse.RetCodeParse;
import com.palmedia.framework.business.BaseBusi;
import com.palmedia.framework.myinterface.UiCallBack;
import com.palmedia.framework.network.UploadFileVO;
import com.palmedia.framework.parse.BaseParse;
/**
 * @author xudeliang
 * 曝光
 */
public class ExposureBusi extends BaseBusi
{

	/*  *//**
     * 设置表单数据
     *//*
	public void setFormData( Map<String, String> map_normal)
	{
		this.map_normal=map_normal;
	}

	
	*//**
     * 设置上传文件数据
     *//*
	public void setUploadFileData( Map<String, UploadFileVO> map_file)
	
	{
		this.map_file=map_file;
	}
	*/
	private  String  tail = "exposure.php";
	
	
	public String brand;
	public String contact;
	public String content;
	public String verifycode;
	
	public String filePath;
	
	public String userid;
	
	public ExposureBusi(UiCallBack bCallBack)
	{
		super(bCallBack);
	}
	
	public void iExecute()
    {
		reqParam = tail;
		
		Map<String, String> mapnormal = new HashMap<String, String>();
		mapnormal.put("brand", brand);
		mapnormal.put("contact", contact);
		mapnormal.put("content", content);
		mapnormal.put("code",verifycode);
		mapnormal.put("userid",userid);
		this.setFormData(mapnormal);
		
		if(filePath!=null &&filePath.length()>0)
		{
			Map<String, UploadFileVO> mapfile = new HashMap<String,UploadFileVO>();
			UploadFileVO vo = new UploadFileVO(filePath);
			int dotindex = filePath.lastIndexOf('.');
			int pl = filePath.lastIndexOf('/');
			String ext =filePath.substring(dotindex+1);
			vo.setContentType("image/"+ext);
			String filename =filePath.substring(pl+1);
			vo.setFileName(filename);
			mapfile.put("file", vo);
			this.setUploadFileData(mapfile);
		}
		
    	super.iExecute();
    }
	
	@Override
	protected BaseParse parseResult(byte[] data)
	{
		RetCodeParse	ls = new RetCodeParse();
		ls.Parse(data);
		return ls;
	}
	
	
	
}
